﻿<phone:PhoneApplicationPage
    x:Class="Sinergija13.WP7App.Views.TwitterSettingsView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" 
    xmlns:b="clr-namespace:Sinergija13.WP7App.Infrastructure.Behaviours"
    xmlns:prismInteractivity="clr-namespace:Microsoft.Practices.Prism.Interactivity;assembly=Microsoft.Practices.Prism.Interactivity"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" 
    xmlns:prismInteractionRequest="clr-namespace:Microsoft.Practices.Prism.Interactivity.InteractionRequest;assembly=Microsoft.Practices.Prism.Interactivity"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="False"
    
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    
    Style="{StaticResource TransitionPageStyle}"
    
    DataContext="{Binding Source={StaticResource ViewModelLocator}, Path=TwitterSettingsViewModel}"
    
    toolkit:TiltEffect.IsTiltEnabled="True">

    <phone:PhoneApplicationPage.Resources>
        <!-- RESOURCES -->
        <DataTemplate x:Key="tweetTypeOptionItem">          
                <TextBlock Text="{Binding}"/>
        </DataTemplate>

    </phone:PhoneApplicationPage.Resources>
            <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel Grid.Row="0" Margin="12,17,0,28">
            <TextBlock Text="Sinergija 13 - twitter podešavanja" Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock Text="podešavanja" Margin="9,0,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">       
            <Grid x:Name="ContentGrid" VerticalAlignment="Top">
                <StackPanel Orientation="Vertical">
                    <toolkit:ListPicker
                                Header="Twitter filter:"
                                ItemsSource="{Binding TweetTypeOptions}"
                                SelectionMode="Single" 
                                ItemTemplate="{StaticResource tweetTypeOptionItem}"
                                SelectedIndex="{Binding CurrentSelectedIndex, Mode=TwoWay}">                   
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="SelectionChanged" >
                                <i:InvokeCommandAction Command="{Binding SelectionChangedCommand}" />
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                    </toolkit:ListPicker>
                    <TextBlock Text="{Binding OptionDescription}" Margin="12,10,0,0" TextWrapping="Wrap" Foreground="{StaticResource PhoneForegroundBrush}"/>
                    <Button HorizontalAlignment="Left" Margin="0,50,0,0">
                        <Button.Content>
                            <TextBlock Text="Obriši sve tweet-ove" FontSize="20" Foreground="{StaticResource PhoneForegroundBrush}"/>
                        </Button.Content>
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="Click" >
                                <i:InvokeCommandAction Command="{Binding ClearTwitterDataStoreCommand}" />
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                    </Button>
                    <TextBlock Text="Tweet-ovi su obrisani." Margin="15,0,0,0" Style="{StaticResource PhoneTextSubtleStyle}"
                               Visibility="{Binding TweetsDeleted, Mode=TwoWay, Converter={StaticResource VisibilityConverter}}"/>
                </StackPanel>
            </Grid>
        </Grid>
    </Grid>
</phone:PhoneApplicationPage>